package com.bdqn.service.impl;


import com.bdqn.mapper.SysRoleMapper;
import com.bdqn.pojo.SysRole;
import com.bdqn.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleService {
    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Transactional(propagation = Propagation.SUPPORTS)
    @Override
    public List<SysRole> selectList(SysRole sysRole) {
        return sysRoleMapper.selectList(sysRole);
    }

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int addRole(SysRole sysRole) {
        return sysRoleMapper.addRole(sysRole);
    }

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int deleteRole(Integer id) {
        return sysRoleMapper.deleteRole(id);
    }
}
